/**
 * 
 */
package org.picWeb.view.background;

import org.picWeb.entity.SysUser;
import org.picWeb.view.BaseAction;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author zjm
 * @version org.picWeb.view.background/SysUserAction.java 2011-6-20
 */

@Controller
public class SysUserAction extends BaseAction {

	@RequestMapping("back/sysUserList")
	public String list(SysUser user, Integer currentPage, String orderby, boolean desc, ModelMap model) {
		if (null == user) {
			user = new SysUser();
		}

		baseActionService.list(user, currentPage, orderby, desc, false, null, model);

		return "background/sysUser/list";
	}

	@RequestMapping("back/sysUserGet")
	public String get(String id, ModelMap model) {
		String page = "background/sysUser/addMdf";
		if (null == id) {
			return page;
		}
		baseActionService.get(SysUser.class, id, model);
		return page;
	}

	@RequestMapping("back/sysUserAddMdf")
	public String addMdf(SysUser user) {
		baseActionService.saveUpdate(user, null);

		return "background/util/PopupSuccess";
	}

	@RequestMapping("back/sysUserDelete")
	public String delete(SysUser user, ModelMap model) {
		baseActionService.delete(user, null);
		return this.list(null, 0, null, true, model);
	}

}
